package com.wuzf.mall.bottom

import android.widget.Toast
import com.wuzf.mall.fragment.BaseFragment

abstract class BottomTabFragment : BaseFragment() {

    private var lastTime = 0L

    companion object {
        private const val INTERVAL_TIME = 2000L
    }

    override fun onBackPressedSupport(): Boolean {
        if (System.currentTimeMillis() - lastTime < INTERVAL_TIME) {
            _mActivity.finish()
        } else {
            lastTime = System.currentTimeMillis()
            Toast.makeText(_mActivity, "双击退出", Toast.LENGTH_LONG).show()
        }
        return true
    }
}